package com.gexiaobao.pigeon.ui.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.gexiaobao.pigeon.R
import com.gexiaobao.pigeon.app.base.DataBindBaseViewHolder
import com.gexiaobao.pigeon.app.model.bean.AllReserveMemberInfoResponse
import com.gexiaobao.pigeon.databinding.ItemAllReserveMemberInfoBinding

/**
 * @Author      : hxw
 * @Date        : 2024/6/22 10:42
 * @Describe    :
 */
class AdapterAllReserveMemberInfo(data: ArrayList<AllReserveMemberInfoResponse.ListBean>) :
    BaseQuickAdapter<AllReserveMemberInfoResponse.ListBean, DataBindBaseViewHolder>(
        R.layout.item_all_reserve_member_info, data
    ) {
    override fun convert(holder: DataBindBaseViewHolder, item: AllReserveMemberInfoResponse.ListBean) {
        val binding = DataBindBaseViewHolder.getBinding(holder) as ItemAllReserveMemberInfoBinding
        binding.data = item
        binding.executePendingBindings()//防止列表抖动

        val state = if (item.state == 2) {
            context.getString(R.string.have_confirmed)
        } else {
            "--"
        }
        holder.setText(R.id.tvReserveState, state)
    }
}